Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed naming conventions and used RecyclableMemoryStream instead of M… #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

01Vladimir10
Copy link

…emoryStream

@mlhpdx
Copy link
Owner

mlhpdx commented Feb 1, 2023

Just FYI, I'm looking at this. The pooled memory stream seems like a win (here and in the seekable-s3-stream code as well).

@inbarbarkai
Copy link

I recommend getting a factory method in the constructor to create memory streams.
That way you can inject the manager you want to use.

Example:

class MyClass
{
    private readonly Func<MemoryStream> _streamFactory;

    public MyClass(Func<MemoryStream> streamFactory = null)
    {
        _streamFactory = streamFactory ?? () => new MemoryStream();
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants